package com.lzj.demo.design.strategy;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum FileTypeResolveEnum {
    File_A_RESOLVE("A","A文件"),
    File_B_RESOLVE("B","B文件"),
    File_DEFAULT_RESOLVE("DEFAULT","默认文件");
    private String code;
    private String name;

    public static FileTypeResolveEnum getEnumByEnCode(String code) {
        for (FileTypeResolveEnum dataEnum : FileTypeResolveEnum.values()) {
            if (dataEnum.getCode().equals(code)) {
                return dataEnum;
            }
        }
        return FileTypeResolveEnum.File_DEFAULT_RESOLVE;
    }
}
